package ciyuan;

import ciyuan.Block.BlockRegistryManager;
import ciyuan.Block.Mortar.MortarScreen;
import ciyuan.Entity.EntityRegisterManager;
import ciyuan.Gui.ContainerRegistry;
import ciyuan.Gui.Particle.ParticleRegistry;
import ciyuan.Item.ItemRegisterManager;
import ciyuan.Utils.FluidRegisterManager;
import ciyuan.Utils.SoundEventRegistry;
import ciyuan.Utils.TileEntityRegisterManager;
import net.minecraft.client.gui.ScreenManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * @author 150149
 */
@Mod("ciyuanrpg")
public class MainClass
{
    public static MainClass instance;
    private static final Logger LOGGER = LogManager.getLogger();
    public static final String MODID = "ciyuanrpg";

    public MainClass() {
        instance = this;
        MinecraftForge.EVENT_BUS.register(this);
        ItemRegisterManager.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        BlockRegistryManager.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
        SoundEventRegistry.SOUNDS.register(FMLJavaModLoadingContext.get().getModEventBus());
        ContainerRegistry.CONTAINERS.register(FMLJavaModLoadingContext.get().getModEventBus());
        TileEntityRegisterManager.TILE_ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus());
        FluidRegisterManager.FLUIDS.register(FMLJavaModLoadingContext.get().getModEventBus());
        EntityRegisterManager.ENTITY_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus());
        ParticleRegistry.PARTICLE_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus());
    }



    @SubscribeEvent
    public static void onClientSetupEvent(FMLClientSetupEvent event) {
        event.enqueueWork(() -> {
            ScreenManager.register(ContainerRegistry.obsidianFirstContainer.get(), MortarScreen::new);
        });
    }

}
